<?php
    @include_once("conn.php");
    @include_once("common.php");

    $user = $_POST["user"];
    $pwd = $_POST["pwd"];
    $phone = $_POST["phone"];
    $email = $_POST["email"];

    if(!($user&&$pwd&&$phone&&$email)){
        argErr();
    }

    $insert = "insert into `regi`(user,pwd,phone,email) values('$user','$pwd','$phone','$email')";
    mysqli_query($conn,$insert);  
    $rows = mysqli_affected_rows($conn);
    $obj = array();
    if($rows>0){
        $obj["status"] = true;
        $obj["detail"] = "注册成功";
    }else{
        $obj["status"] = false;
        $obj["detail"] = "注册失败";
        $obj["sql"] = $insert;
    }

    echo json_encode($obj);

?>